<div id="main-content">
    <div class="container">
    	<div class="row">
    		<div id="content" class="col-lg-12">
    			<!-- PAGE HEADER-->
                    <div class="row">
							<div class="col-sm-12">
								<div class="page-header">
									<div class="clearfix">
										<h3 class="content-title pull-left">Quản lí danh hiệu</h3>
									</div>
								</div>
							</div>
					</div>
                    <!-- DATA TABLES -->
						<div class="row">
							<div class="col-md-12">
								<!-- BOX -->
								<div class="box border green">
									<div class="box-title">
										<h4><i class="fa fa-table"></i>Danh sách</h4>
										<div class="tools hidden-xs">
											<a href="javascript:;" data-toggle="tooltip" title="Ẩn đi" class="collapse">
												<i class="fa fa-chevron-up"></i>
											</a>
										</div>
									</div>
									<div class="box-body">
                                    <?php if(!empty($data)): ?>
										<table id="datatable1" cellpadding="0" cellspacing="0" border="0" class="datatable table table-striped table-bordered table-hover">
											<thead>
												<tr>
                                                    <th>STT</th>
													<th class="center">Name</th>
													<th class="center">Bằng cấp</th>
													<th class="center">Bảng điểm</th>
													<th class="center">Thành tích</th>
													<th class="center">Chứng chỉ</th>
													<th class="center">Sửa</th>
													<th class="center">Xóa</th>
												</tr>
											</thead>
											<tbody>
                                            <?php 
												$i=0; 
												foreach ($data as $data) {
													$i++; 
													$bangcap = $data->bangcap;
													$bangdiem = $data->bangdiem;
													$thanhtich = $data->thanhtich;
													$chungchi = $data->chungchi;
													$chuadoc = '';
													if(!empty($bangcap)){
														$bangcap = explode(",", $bangcap);
														if($data->thanhtich1 == 0){
															$chuadoc = ' chuadoc';
														}
													}
													if(!empty($bangdiem)){
														$bangdiem = explode(",", $bangdiem);
														if($data->thanhtich2 == 0){
															$chuadoc = ' chuadoc';
														}
													}
													if(!empty($thanhtich)){
														$thanhtich = explode(",", $thanhtich);
														if($data->thanhtich3 == 0){
															$chuadoc = ' chuadoc';
														}
													}
													if(!empty($chungchi)){
														$chungchi = explode(",", $chungchi);
														if($data->thanhtich4 == 0 || $data->thanhtich5 == 0){
															$chuadoc = ' chuadoc';
														}
													}
											?>
												<tr class="gradeX">
													<td class="<?php echo $chuadoc;?>"><?php echo $i;  ?></td>
													<td class="center<?php echo $chuadoc;?>"><?php echo $data->name;  ?></td>
													<td class="center<?php echo $chuadoc;?>">
														<?php
															if(!empty($bangcap)){
																foreach($bangcap as $bangcap){
																	echo '<a href="'.$bangcap.'" target="_blank"><img style="margin:5px;box-shadow: 0px 0px 5px #777;border: 2px solid #FFF;" src="http://localhost/10cong/thumb.php?src='.$bangcap.'&amp;w=42&amp;h=54&amp;q=90" class="big_images" height="54" width="42"></a>';
																}
															}
														?>
													</td>
													<td class="center<?php echo $chuadoc;?>">
														<?php
															if(!empty($bangdiem)){
																foreach($bangdiem as $bangdiem){
																	echo '<a href="'.$bangdiem.'" target="_blank"><img style="margin:5px;box-shadow: 0px 0px 5px #777;border: 2px solid #FFF;" src="http://localhost/10cong/thumb.php?src='.$bangdiem.'&amp;w=42&amp;h=54&amp;q=90" class="big_images" height="54" width="42"></a>';
																}
															}
														?>
													</td>
													<td class="center<?php echo $chuadoc;?>">
														<?php
															if(!empty($thanhtich)){
																foreach($thanhtich as $thanhtich){
																	echo '<a href="'.$thanhtich.'" target="_blank"><img style="margin:5px;box-shadow: 0px 0px 5px #777;border: 2px solid #FFF;" src="http://localhost/10cong/thumb.php?src='.$thanhtich.'&amp;w=42&amp;h=54&amp;q=90" class="big_images" height="54" width="42"></a>';
																}
															}
														?>
													</td>
													<td class="center<?php echo $chuadoc;?>">
														<?php
															if(!empty($chungchi)){
																foreach($chungchi as $chungchi){
																	echo '<a href="'.$chungchi.'" target="_blank"><img style="margin:5px;box-shadow: 0px 0px 5px #777;border: 2px solid #FFF;" src="http://localhost/10cong/thumb.php?src='.$chungchi.'&amp;w=42&amp;h=54&amp;q=90" class="big_images" height="54" width="42"></a>';
																}
															}
														?>
													</td>
													<td class="center<?php echo $chuadoc;?>"><a href="<?php echo base_url().'admin/xuly/thanhtich/edit/'.$data->id?>"><i class="fa fa-edit fa-2x"></i></a></td>
                                                    <td class="center<?php echo $chuadoc;?>"><a onclick="return confirm('Bạn có muốn xóa không?');" href="<?php echo base_url().'admin/xuly/thanhtich/xoa/'.$data->id.'/'.$this->uri->segment(5)?>"><i class="fa fa-trash-o fa-2x red"></td>
												</tr>
                                                <?php } ?>
											</tbody>
										</table>
                                        <?php endif; ?>
		                                <div class="row">
                                               <div class="col-sm-12">
                                                  <div class="pull-right">
                                                           <?php echo $this->pagination->create_links();?>
                                                  </div>
                                                  <div class="clearfix"></div>
                                               </div>
                                            </div>
                                    </div>
								</div>
								<!-- /BOX -->
							</div>
						</div>
						<!-- /DATA TABLES -->
    			</div>
    			<!-- /PAGE HEADER -->
    		</div>
    	</div>
    </div>
</div>